package com.mmy.fta.cargo.server.enums;

public enum ErrorCode {
	CAN_NOT_FIND_ORDER(1, "Can Not Find Order", false),
	IN_PARAM_NULL(2,"Parameter Is Null", false),
	IN_PARAM_SIZE_EXCEED_MAX(2,"参数长度超限，限制批量查询order数上限为100，批量查询请求号数上限为500", false),
	CAN_NOT_FIND_ORDER_BILL(2, "Can Not Find Order Bill", false),
	CAN_NOT_FIND_ORDER_BILL_DETAIL(3, "Can Not Find Order Bill Detail", false),
	CAN_NOT_FIND_ORDER_BILL_ITEM(4, "Can Not Find Order Bill ITEM", false),
	REJECT_AUDIT_FAIL(5, "Reject audit fail", false),
	CAN_NOT_FIND_ORDER_ADVANCE_DEPOSIT(8, "Can Not Find Order Advance Deposit", false),
	CAN_NOT_FIND(6, "Can Not Find Record", false),
	CAN_NOT_FIND_ORDER_ELECTRONIC_CONTRACT(7, "Can Not Find Order Electronic Contract", false),
	INVALID_PARAMETER(9, "Invalid Parameter", false),
	RED_PACKET_ACTIVITY_NOT_EXIST(10, "红包活动不存在", true),
	RED_PACKET_ACTIVITY_NOT_EFFECTIVE(11, "红包活动未开始或已经结束", true),
	RED_PACKET_NOT_ENOUGH(11, "红包已送完", true),
	INVALID_RED_PACKET_ACTIVITY(12, "无效的红包活动", true),
	RED_PACKET_CLAIMED(13, "不能重复领取", true),
	RED_PACKET_USER_LIMIT(14, "领取红包数已达到上限", true),
	RED_PACKET_USER_ONE_DAY_LIMIT(15, "当天领取红包数达到上限", true),
	RED_PACKET_RULE_NOT_EXIST(16, "红包规则不存在", true),
	FREIGHT_APPLY_NOT_EXIST(17, "申请单不存在", true),
	ITEM_NOT_CONTAINED_IN_FREIGHT_APPLY(18, "申请单不包含给定的付款项", true),
	BILL_ITEM_ALREADY_AUTO_PAID(19, "支付项已经自动支付", false),
	MYB_ADVERTISEMENT_CONFLICT(17, "该时间段已存在广告，请修改广告位置或时间后重新提交", true),
	ALREADY_EXIST_BLACK_WHITE_LIST(20, "黑白名单已存在", true),
	CONCURRENT_UPDATE_ORDER_BILL(21, "Order bill was updated concurrently", false),

	ORDER_BATCH_TASK_IS_EMPTY(22,"批处理订单为空", false),
	ORDER_BATCH_TASK_PARTITION_FINISH(23,"批处理订单部分完成", false),
	ORDER_BATCH_TASK_TYPE_ILLEGAL(24,"批处理订单类型不正确", false),
	ORDER_BATCH_TASK_STATUS_ILLEGAL(25,"批处理订单状态不正确", false),
	ORDER_BATCH_TASK_LIST_EMPTY(26,"批处理订单为空", false),
	ORDER_BATCH_TASK_MIN_ID_IS_NULL(27, "不存在最小ID，找不到指定状态的批处理订单", false),

	ORDER_RELATION_LIST_ERROR(28, "查询定金依赖关系错误", false),
	GENERATE_ORDER_ID_ERROR(29,"生成订单主键id错误",false),
	PARAM_SIZE_ILLEGAL(30,"参数集合大小不合法",false),

	BAD_REQUEST(-203, "无效的请求",false),

	BILL_ITEM_ALREADY_EXISTS_PAYEE_ID(999999, "付款项已存在收款人ID", false),

	BILL_ITEM_UPDATE_PAYEE_ID_ERROR(999999, "更新付款项的收款人ID出错", false),
	BILL_ITEM_UPDATE_PAYER_ID_ERROR(999999, "更新付款项的付款人ID出错", false),

	SYS_ERROR(999999, "SYS_ERROR", false),

	NO_PERMISSION_PROJECT(999999, "NO_PERMISSION_PROJECT", false),

	WAYBILL_WITH_NON_INITIAL_STATE(40,"存在状态为非承运中的运单",false),

	BEGIN_TIME_ERROR(80,"开始计时失败",false),
	PAUSE_TIME_ERROR(90,"开始计时失败",false),
	END_TIME_ERROR(100,"结束计时失败",false);


	public final int code;
	public final String msg;

	/**
	 * 是否业务错误，如果是，msg直接提示给用户
	 */
	public final boolean isBizError;

	private ErrorCode(int code, String msg, boolean isBizError) {
		this.code = code;
		this.msg = msg;
		this.isBizError = isBizError;
	}
}
